package com.xca.daggerdemo.module;

import android.content.Context;

import com.xca.daggerdemo.database.CourseDBHelper;
import com.xca.daggerdemo.database.DBHelper;

import dagger.Module;
import dagger.Provides;
import jakarta.inject.Singleton;

@Module
public class DBModule {
    private Context mContext;
    public DBModule(Context context) {
        mContext = context;
    }

    @Singleton
    @Provides
    public Context contextProvider() {
        return mContext;
    }

    @Singleton
    @Provides
    public DBHelper dbHelperProvider(Context context) {
        return new DBHelper(context);
    }
    @Singleton
    @Provides
    public CourseDBHelper courseDBHelper(Context context){
        return new CourseDBHelper(context) ;
    }
}
